3v4l.org

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