3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $a = 23; protected $b = 42; private $c = 666; public function exposeMe() { return get_object_vars($this); } } $foo = new Foo(); var_dump($foo->exposeMe()); $expose = function() { return get_object_vars($this); }; $fooExpose = $expose->bindTo($foo, get_class($foo)); var_dump($fooExpose());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ELP0b
function name:  (null)
number of ops:  22
compiled vars:  !0 = $foo, !1 = $expose, !2 = $fooExpose
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   15     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'exposeMe'
          5        DO_FCALL                                      0  $6      
          6        SEND_VAR                                                 $6
          7        DO_ICALL                                                 
   18     8        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
          9        ASSIGN                                                   !1, ~8
   22    10        INIT_METHOD_CALL                                         !1, 'bindTo'
         11        SEND_VAR_EX                                              !0
         12        GET_CLASS                                        ~10     !0
         13        SEND_VAL_EX                                              ~10
         14        DO_FCALL                                      0  $11     
         15        ASSIGN                                                   !2, $11
   24    16        INIT_FCALL                                               'var_dump'
         17        INIT_DYNAMIC_CALL                                        !2
         18        DO_FCALL                                      0  $13     
         19        SEND_VAR                                                 $13
         20        DO_ICALL                                                 
         21      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ELP0b
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'get_object_vars'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   20     5*     > RETURN                                                   null

End of Dynamic Function 0

Class Foo:
Function exposeme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ELP0b
function name:  exposeMe
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'get_object_vars'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   11     5*     > RETURN                                                   null

End of function exposeme

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.92 ms | 1004 KiB | 15 Q