📄 bug29311.phpt
字号:
--TEST--constructor test--SKIPIF--<?php require_once('skipif.inc'); ?>--FILE--<?php include "connect.inc"; /* class 1 calls parent constructor */ class mysql1 extends mysqli { function __construct() { global $host, $user, $passwd; parent::__construct($host, $user, $passwd, "test"); } } /* class 2 has an own constructor */ class mysql2 extends mysqli { function __construct() { global $host, $user, $passwd; $this->connect($host, $user, $passwd, "test"); } } /* class 3 has no constructor */ class mysql3 extends mysqli { } $foo[0] = new mysql1(); $foo[1] = new mysql2(); $foo[2] = new mysql3($host, $user, $passwd, "test"); for ($i=0; $i < 3; $i++) { if (($result = $foo[$i]->query("SELECT DATABASE()"))) { $row = $result->fetch_row(); printf("%d: %s\n", $i, $row[0]); $result->close(); } $foo[$i]->close(); }?>--EXPECTF--0: test1: test2: test
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -