3v4l.org

run code in 300+ PHP versions simultaneously
<?php function with($o) { return $o; } class Foo { function getSets() { return ['pizza'=>'bar']; } } class Bar { public $controller; function __construct() { $this->controller = new Foo; } function test() { echo with((object)with((object)get_object_vars($this))->controller->getSets())->pizza; } } $b = new Bar; $b->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sDpZL
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function with:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sDpZL
function name:  with
number of ops:  3
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1      > RETURN                                                   !0
    4     2*     > RETURN                                                   null

End of function with

Class Foo:
Function getsets:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sDpZL
function name:  getSets
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   <array>
    8     1*     > RETURN                                                   null

End of function getsets

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sDpZL
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'controller'
          3        OP_DATA                                                  $1
   15     4      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sDpZL
function name:  test
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'with'
          1        INIT_FCALL                                               'with'
          2        INIT_FCALL                                               'get_object_vars'
          3        FETCH_THIS                                       ~0      
          4        SEND_VAL                                                 ~0
          5        DO_ICALL                                         $1      
          6        CAST                                          8  ~2      $1
          7        SEND_VAL                                                 ~2
          8        DO_FCALL                                      0  $3      
          9        FETCH_OBJ_R                                      ~4      $3, 'controller'
         10        INIT_METHOD_CALL                                         ~4, 'getSets'
         11        DO_FCALL                                      0  $5      
         12        CAST                                          8  ~6      $5
         13        SEND_VAL                                                 ~6
         14        DO_FCALL                                      0  $7      
         15        FETCH_OBJ_R                                      ~8      $7, 'pizza'
         16        ECHO                                                     ~8
   18    17      > RETURN                                                   null

End of function test

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.47 ms | 1407 KiB | 17 Q