3v4l.org

run code in 300+ PHP versions simultaneously
<?php //assert($a == $b); // 相等 $i = 0; while ($i < 5) { if ($i === 3) { break; // 退出循环 } echo $i++; } // 输出 "012" for ($i = 0; $i < 5; $i++) { if ($i === 3) { continue; // 跳过此次遍历 } echo $i; } // 输出 "0124" $nowdoc = <<<'END' Multi line string END; $inc = function ($x) { return $x + 1; }; echo $inc(2); // => 3 function foo ($x, $y, $z) { echo "$x - $y - $z"; } echo $nowdoc;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
Branch analysis from position: 11
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
Branch analysis from position: 11
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 2
Branch analysis from position: 9
Branch analysis from position: 2
filename:       /in/pRLjD
function name:  (null)
number of ops:  27
compiled vars:  !0 = $i, !1 = $nowdoc, !2 = $inc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 0
    5     1      > JMP                                                      ->7
    6     2    >   IS_IDENTICAL                                             !0, 3
          3      > JMPZ                                                     ~4, ->5
    7     4    > > JMP                                                      ->9
    9     5    >   POST_INC                                         ~5      !0
          6        ECHO                                                     ~5
    5     7    >   IS_SMALLER                                               !0, 5
          8      > JMPNZ                                                    ~6, ->2
   12     9    >   ASSIGN                                                   !0, 0
         10      > JMP                                                      ->16
   13    11    >   IS_IDENTICAL                                             !0, 3
         12      > JMPZ                                                     ~8, ->14
   14    13    > > JMP                                                      ->15
   16    14    >   ECHO                                                     !0
   12    15    >   PRE_INC                                                  !0
         16    >   IS_SMALLER                                               !0, 5
         17      > JMPNZ                                                    ~10, ->11
   18    18    >   ASSIGN                                                   !1, 'Multi+line%0Astring'
   22    19        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpRLjD%3A22%240'
         20        ASSIGN                                                   !2, ~12
   26    21        INIT_DYNAMIC_CALL                                        !2
         22        SEND_VAL_EX                                              2
         23        DO_FCALL                                      0  $14     
         24        ECHO                                                     $14
   31    25        ECHO                                                     !1
         26      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FpRLjD%3A22%240

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pRLjD
function name:  foo
number of ops:  10
compiled vars:  !0 = $x, !1 = $y, !2 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   29     3        ROPE_INIT                                     5  ~4      !0
          4        ROPE_ADD                                      1  ~4      ~4, '+-+'
          5        ROPE_ADD                                      2  ~4      ~4, !1
          6        ROPE_ADD                                      3  ~4      ~4, '+-+'
          7        ROPE_END                                      4  ~3      ~4, !2
          8        ECHO                                                     ~3
   30     9      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.44 ms | 1399 KiB | 13 Q