3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $privateProperty = "hello"; public function myMethod() { $prop = &$this; $map = array_map( function($value) use($prop) { return $prop->privateProperty." ".$value; }, array( "city", "world", "universe" ) ); return $map; } } $test = new Test(); print_r($test->myMethod());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kr5ut
function name:  (null)
number of ops:  9
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_FCALL                                               'print_r'
          4        INIT_METHOD_CALL                                         !0, 'myMethod'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fkr5ut%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kr5ut
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $value, !1 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   10     2        FETCH_OBJ_R                                      ~2      !1, 'privateProperty'
          3        CONCAT                                           ~3      ~2, '+'
          4        CONCAT                                           ~4      ~3, !0
          5      > RETURN                                                   ~4
   11     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fkr5ut%3A9%240

Class Test:
Function mymethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kr5ut
function name:  myMethod
number of ops:  11
compiled vars:  !0 = $prop, !1 = $map
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       $2      
          1        ASSIGN_REF                                               !0, $2
    8     2        INIT_FCALL                                               'array_map'
    9     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fkr5ut%3A9%240'
          4        BIND_LEXICAL                                             ~4, !0
   11     5        SEND_VAL                                                 ~4
   13     6        SEND_VAL                                                 <array>
          7        DO_ICALL                                         $5      
    8     8        ASSIGN                                                   !1, $5
   18     9      > RETURN                                                   !1
   19    10*     > RETURN                                                   null

End of function mymethod

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.81 ms | 1396 KiB | 17 Q