3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { public function __construct(){ echo __CLASS__; } } $obj = new myClass; $flower = "violet"; $obj->color = function()use($flower){ $arr = ["rose"=>"red", "violet"=>"blue", "grass"=>"green"]; return $arr[$flower]; }; echo "...{$flower}s are ",($obj->color)();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkFMG
function name:  (null)
number of ops:  17
compiled vars:  !0 = $obj, !1 = $flower
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'myClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    9     3        ASSIGN                                                   !1, 'violet'
   11     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZkFMG%3A11%240'
          5        BIND_LEXICAL                                             ~7, !1
          6        ASSIGN_OBJ                                               !0, 'color'
   17     7        OP_DATA                                                  ~7
   18     8        ROPE_INIT                                     3  ~9      '...'
          9        ROPE_ADD                                      1  ~9      ~9, !1
         10        ROPE_END                                      2  ~8      ~9, 's+are+'
         11        ECHO                                                     ~8
         12        FETCH_OBJ_R                                      ~11     !0, 'color'
         13        INIT_DYNAMIC_CALL                                        ~11
         14        DO_FCALL                                      0  $12     
         15        ECHO                                                     $12
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZkFMG%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkFMG
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $flower, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   BIND_STATIC                                              !0
   12     1        ASSIGN                                                   !1, <array>
   16     2        FETCH_DIM_R                                      ~3      !1, !0
          3      > RETURN                                                   ~3
   17     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZkFMG%3A11%240

Class myClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkFMG
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'myClass'
    6     1      > RETURN                                                   null

End of function __construct

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.18 ms | 1395 KiB | 13 Q