3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); ini_set('display_errors', 'On'); class Kitchen { private $value = 'cheese'; } $k = new Kitchen(); $m = function(){ echo 'called me. Value is ' . $this->value; }; Closure::bind($m, null, $kitchen); $k->m();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jiZ7
function name:  (null)
number of ops:  20
compiled vars:  !0 = $k, !1 = $m, !2 = $kitchen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'ini_set'
          4        SEND_VAL                                                 'display_errors'
          5        SEND_VAL                                                 'On'
          6        DO_ICALL                                                 
   13     7        NEW                                              $5      'Kitchen'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $5
   16    10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4jiZ7%3A16%240'
         11        ASSIGN                                                   !1, ~8
   20    12        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 null
         15        SEND_VAR                                                 !2
         16        DO_FCALL                                      0          
   22    17        INIT_METHOD_CALL                                         !0, 'm'
         18        DO_FCALL                                      0          
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4jiZ7%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jiZ7
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'value'
          2        CONCAT                                           ~2      'called+me.+Value+is+', ~1
          3        ECHO                                                     ~2
   18     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4jiZ7%3A16%240

Class Kitchen: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.38 ms | 1395 KiB | 17 Q