3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new class { private function _doAdd($id) { echo "Added: " . $id; } }; $addProduct = function($id) { $this->_doAdd($id); }; $addProduct->call($obj, 1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ml9hT
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj, !1 = $addProduct
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <true>  
          1        NEW                                              $3      $2
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    9     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMl9hT%3A9%241'
          5        ASSIGN                                                   !1, ~6
   13     6        INIT_METHOD_CALL                                         !1, 'call'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAL_EX                                              1
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMl9hT%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ml9hT
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        FETCH_THIS                                       $1      
          2        INIT_METHOD_CALL                                         $1, '_doAdd'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   11     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMl9hT%3A9%241

Class class@anonymous:
Function _doadd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ml9hT
function name:  _doAdd
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        CONCAT                                           ~1      'Added%3A+', !0
          2        ECHO                                                     ~1
    6     3      > RETURN                                                   null

End of function _doadd

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.48 ms | 1394 KiB | 13 Q