3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { } $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/TqoY0
function name:  (null)
number of ops:  16
compiled vars:  !0 = $obj, !1 = $flower
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $2      'myClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    7     3        ASSIGN                                                   !1, 'violet'
    8     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTqoY0%3A8%240'
          5        BIND_LEXICAL                                             ~7, !1
          6        ASSIGN_OBJ                                               !0, 'color'
   14     7        OP_DATA                                                  ~7
   16     8        ROPE_INIT                                     3  ~9      '...'
          9        ROPE_ADD                                      1  ~9      ~9, !1
         10        ROPE_END                                      2  ~8      ~9, 's+are+'
         11        ECHO                                                     ~8
         12        INIT_METHOD_CALL                                         !0, 'color'
         13        DO_FCALL                                      0  $11     
         14        ECHO                                                     $11
         15      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FTqoY0%3A8%240

Class myClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.17 ms | 1394 KiB | 13 Q