xref: /PHP-5.4/Zend/tests/bug33999.phpt (revision 610c7fbe)
1--TEST--
2Bug #33999 (object remains object when cast to int)
3--INI--
4error_reporting=4095
5--FILE--
6<?php
7class Foo {
8  public $bar = "bat";
9}
10
11$foo = new Foo;
12var_dump($foo);
13
14$bar = (int)$foo;
15var_dump($bar);
16
17$baz = (float)$foo;
18var_dump($baz);
19?>
20--EXPECTF--
21object(Foo)#1 (1) {
22  ["bar"]=>
23  string(3) "bat"
24}
25
26Notice: Object of class Foo could not be converted to int in %sbug33999.php on line 9
27int(1)
28
29Notice: Object of class Foo could not be converted to double in %sbug33999.php on line 12
30float(1)
31