3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = (object) array( "\0*\0bar" => 1, "\0Foo\0baz" => 2, ); class Foo { public function getVars($obj) { var_dump(get_object_vars($obj)); } } var_dump(get_object_vars($obj)); (new Foo())->getVars($obj); var_dump($obj->{"\0*\0bar"}); var_dump($obj->{"\0Foo*\0baz"});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3IBOl
function name:  (null)
number of ops:  22
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~1      <array>
    3     1        ASSIGN                                                   !0, ~1
   16     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'get_object_vars'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
   17     8        NEW                                              $5      'Foo'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $5, 'getVars'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
   18    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~8      !0, '%00%2A%00bar'
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                                 
   19    17        INIT_FCALL                                               'var_dump'
         18        FETCH_OBJ_R                                      ~10     !0, '%00Foo%2A%00baz'
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Foo:
Function getvars:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3IBOl
function name:  getVars
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'get_object_vars'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
   13     7      > RETURN                                                   null

End of function getvars

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.55 ms | 1396 KiB | 17 Q