mirror of
https://github.com/php/php-src.git
synced 2026-04-16 12:31:06 +02:00
convert_scalar_to_number() will now call cast_object() with an _IS_NUMBER argument, in which case the cast handler should return either an integer or floating point number, whichever is more appropriate. Previously convert_scalar_to_number() unconditionally converted objects to integers instead. Fixes bug #53033. Fixes bug #54973. Fixes bug #73108.
22 lines
409 B
PHP
22 lines
409 B
PHP
--TEST--
|
|
Misoptimization when variable is modified by assert()
|
|
--INI--
|
|
zend.assertions=1
|
|
--FILE--
|
|
<?php
|
|
|
|
function test() {
|
|
$i = 0;
|
|
assert('$i = new stdClass');
|
|
$i += 1;
|
|
var_dump($i);
|
|
}
|
|
test();
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
|
|
|
|
Notice: Object of class stdClass could not be converted to number in %s on line %d
|
|
int(2)
|