1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/magic_methods/bug74340.phpt
DanielEScherzer bce1f4aeb1 Zend/tests: organize some tests with sub directories (3) (#16444)
First pass at moving `Zend/tests/bug*` tests to existing sub directories

Work towards GH-15631
2025-02-10 00:35:51 +00:00

31 lines
548 B
PHP

--TEST--
Bug #74340: Magic function __get has different behavior in php 7.1.x
--FILE--
<?php
class Test
{
public function __get($var)
{
static $first = true;
echo '__get '.$var.PHP_EOL;
if ($first) {
$first = false;
$this->$var;
$this->{$var.'2'};
$this->$var;
}
}
}
$test = new Test;
$test->test;
?>
--EXPECTF--
__get test
Warning: Undefined property: Test::$test in %s on line %d
__get test2
Warning: Undefined property: Test::$test in %s on line %d