3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { } $obj = new myClass; $obj->color = function( $item ){ $arr = ["rose"=>"red", "violet"=>"blue", "grass"=>"green"]; return $arr[$item]; }; $flowers = [0=>"rose",1=>"violet"]; foreach ($flowers as $flower){ echo "{$flower}s are ",($obj->color)($flower),"\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/S3SH1
function name:  (null)
number of ops:  21
compiled vars:  !0 = $obj, !1 = $flowers, !2 = $flower
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $3      'myClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FS3SH1%3A7%240'
          4        ASSIGN_OBJ                                               !0, 'color'
   13     5        OP_DATA                                                  ~7
   16     6        ASSIGN                                                   !1, <array>
   18     7      > FE_RESET_R                                       $9      !1, ->19
          8    > > FE_FETCH_R                                               $9, !2, ->19
   19     9    >   NOP                                                      
         10        FAST_CONCAT                                      ~10     !2, 's+are+'
         11        ECHO                                                     ~10
         12        FETCH_OBJ_R                                      ~11     !0, 'color'
         13        INIT_DYNAMIC_CALL                                        ~11
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $12     
         16        ECHO                                                     $12
         17        ECHO                                                     '%0A'
   18    18      > JMP                                                      ->8
         19    >   FE_FREE                                                  $9
   20    20      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FS3SH1%3A7%240

Class myClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.12 ms | 1395 KiB | 13 Q