3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 0; $a = $value; $closure = function () use ($a) { if (($a << 2) === 0) { throw new \InvalidArgumentException('Not valid number'); } if ($a > 5) { return false; } else { return [ 'a' => 5, 'b' => 10, 'c' => 400000 ]; } }; echo count($closure());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hvA9e
function name:  (null)
number of ops:  10
compiled vars:  !0 = $value, !1 = $a, !2 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        ASSIGN                                                   !1, !0
    5     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhvA9e%3A5%240'
          3        BIND_LEXICAL                                             ~5, !1
          4        ASSIGN                                                   !2, ~5
   21     5        INIT_DYNAMIC_CALL                                        !2
          6        DO_FCALL                                      0  $7      
          7        COUNT                                            ~8      $7
          8        ECHO                                                     ~8
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhvA9e%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hvA9e
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        SL                                               ~1      !0, 2
          2        IS_IDENTICAL                                             ~1, 0
          3      > JMPZ                                                     ~2, ->8
    7     4    >   NEW                                              $3      'InvalidArgumentException'
          5        SEND_VAL_EX                                              'Not+valid+number'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $3
   10     8    >   IS_SMALLER                                               5, !0
          9      > JMPZ                                                     ~5, ->12
   11    10    > > RETURN                                                   <false>
         11*       JMP                                                      ->13
   14    12    > > RETURN                                                   <array>
   19    13*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhvA9e%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.65 ms | 1386 KiB | 13 Q