3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function getVars($obj) { var_dump(get_object_vars($obj)); } } $obj = (object) array( "\0*\0bar" => 1, "\0Foo\0baz" => 2, ); var_dump(get_object_vars($obj)); (new Foo())->getVars($obj); var_dump(Closure::bind(function ($obj) { var_dump($obj->bar, $obj->baz); }, $obj, 'stdClass')->__invoke($obj)); var_dump(serialize($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/KE0rK
function name:  (null)
number of ops:  40
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   CAST                                          8  ~1      <array>
   11     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        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKE0rK%3A18%240'
         16        SEND_VAL                                                 ~8
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 'stdClass'
         19        DO_FCALL                                      0  $9      
         20        INIT_METHOD_CALL                                         $9, '__invoke'
         21        SEND_VAR_EX                                              !0
         22        DO_FCALL                                      0  $10     
         23        SEND_VAR                                                 $10
         24        DO_ICALL                                                 
   19    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'serialize'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $12     
         29        SEND_VAR                                                 $12
         30        DO_ICALL                                                 
   20    31        INIT_FCALL                                               'var_dump'
         32        FETCH_OBJ_R                                      ~14     !0, '%00%2A%00bar'
         33        SEND_VAL                                                 ~14
         34        DO_ICALL                                                 
   21    35        INIT_FCALL                                               'var_dump'
         36        FETCH_OBJ_R                                      ~16     !0, '%00Foo%2A%00baz'
         37        SEND_VAL                                                 ~16
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FKE0rK%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KE0rK
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        FETCH_OBJ_R                                      ~1      !0, 'bar'
          3        SEND_VAL                                                 ~1
          4        FETCH_OBJ_R                                      ~2      !0, 'baz'
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
          7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKE0rK%3A18%240

Class Foo:
Function getvars:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KE0rK
function name:  getVars
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     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                                                 
    8     7      > RETURN                                                   null

End of function getvars

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.89 ms | 1400 KiB | 19 Q