3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lamda = function ($x) { // increment the value of $x return ++$x; }; function countMessages( $num_messages ) { return "Your have $num_messages messages"; } echo countMessages( $lamda(10) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/88Fba
function name:  (null)
number of ops:  10
compiled vars:  !0 = $lamda
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F88Fba%3A2%240'
          1        ASSIGN                                                   !0, ~1
   12     2        INIT_FCALL                                               'countmessages'
          3        INIT_DYNAMIC_CALL                                        !0
          4        SEND_VAL_EX                                              10
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR                                                 $3
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F88Fba%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/88Fba
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        PRE_INC                                          ~1      !0
          2      > RETURN                                                   ~1
    5     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F88Fba%3A2%240

Function countmessages:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/88Fba
function name:  countMessages
number of ops:  6
compiled vars:  !0 = $num_messages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ROPE_INIT                                     3  ~2      'Your+have+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '+messages'
          4      > RETURN                                                   ~1
   10     5*     > RETURN                                                   null

End of function countmessages

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.95 ms | 1398 KiB | 14 Q