3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CurrentOrder { static $orderID = 0; public static function get() { self::$orderID = 'hot dogs'; $order = new CurrentOrder; $order->orderID = 'pizza'; } public function getOrderID() { return $this->orderID; } } $order = new CurrentOrder; var_dump($order->getOrderID());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m1CAV
function name:  (null)
number of ops:  9
compiled vars:  !0 = $order
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'CurrentOrder'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getOrderID'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class CurrentOrder:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m1CAV
function name:  get
number of ops:  8
compiled vars:  !0 = $order
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN_STATIC_PROP                                       'orderID'
          1        OP_DATA                                                  'hot+dogs'
    7     2        NEW                                              $2      'CurrentOrder'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
    8     5        ASSIGN_OBJ                                               !0, 'orderID'
          6        OP_DATA                                                  'pizza'
    9     7      > RETURN                                                   null

End of function get

Function getorderid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m1CAV
function name:  getOrderID
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'orderID'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getorderid

End of class CurrentOrder.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.89 ms | 1387 KiB | 15 Q