3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = function ($a) { return $a * 2; }; assert( true === is_callable($x) ); assert( 4 == $x(2) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7EB6p
function name:  (null)
number of ops:  21
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7EB6p%3A3%240'
          1        ASSIGN                                                   !0, ~1
    7     2        ASSERT_CHECK                                             
          3        INIT_FCALL                                               'assert'
    8     4        INIT_FCALL                                               'is_callable'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        TYPE_CHECK                                    8  ~4      $3
          8        SEND_VAL                                                 ~4
    7     9        SEND_VAL                                                 'assert%28true+%3D%3D%3D+is_callable%28%24x%29%29'
         10        DO_ICALL                                                 
   11    11        ASSERT_CHECK                                             
         12        INIT_FCALL                                               'assert'
   12    13        INIT_DYNAMIC_CALL                                        !0
         14        SEND_VAL_EX                                              2
         15        DO_FCALL                                      0  $6      
         16        IS_EQUAL                                         ~7      $6, 4
         17        SEND_VAL                                                 ~7
   11    18        SEND_VAL                                                 'assert%284+%3D%3D+%24x%282%29%29'
         19        DO_ICALL                                                 
   13    20      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F7EB6p%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.42 ms | 1395 KiB | 17 Q