3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $foo = 1; protected $bar = 2; private $baz = 3; public function toArray() { return (array)$this; } } $foo = new Foo; var_dump($foo->toArray(), (array)$foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ms4Y
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'toArray'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        CAST                                          7  ~5      !0
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class Foo:
Function toarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ms4Y
function name:  toArray
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       ~0      
          1        CAST                                          7  ~1      ~0
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function toarray

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.67 ms | 1394 KiB | 15 Q