3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new class { public function Bar () { echo 'bar'; } }; // This succeeds. I'd argue an error should be generated at this point echo $serFoo = serialize($foo); // Unserialize fails and a notice is generated $unFoo = unserialize($serFoo); // Error generated on call $unFoo->Bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AJY6d
function name:  (null)
number of ops:  16
compiled vars:  !0 = $foo, !1 = $serFoo, !2 = $unFoo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $4      $3
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   10     4        INIT_FCALL                                               'serialize'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $7      
          7        ASSIGN                                           ~8      !1, $7
          8        ECHO                                                     ~8
   13     9        INIT_FCALL                                               'unserialize'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
   16    13        INIT_METHOD_CALL                                         !2, 'Bar'
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Class class@anonymous:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AJY6d
function name:  Bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'bar'
    6     1      > RETURN                                                   null

End of function bar

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.04 ms | 1395 KiB | 17 Q