3v4l.org

run code in 500+ PHP versions simultaneously
<?php function doPrint(string $value): void { echo $value . "\n"; } $a = rand(0,2); match (true) { $a === 0 => doPrint('zero'), $a >= 1 => doPrint('one'), };
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 197) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
filename:       /in/X2Fjm
function name:  (null)
number of ops:  25
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                                   'rand'
          1        SEND_VAL                                                     0
          2        SEND_VAL                                                     2
          3        DO_ICALL                                             $1      
          4        ASSIGN                                                       !0, $1
   10     5        IS_IDENTICAL                                         ~4      !0, 0
          6        IS_IDENTICAL                                                 ~4, <true>
          7      > JMPNZ                                                        ~3, ->13
   11     8    >   IS_SMALLER_OR_EQUAL                                  ~5      1, !0
          9        IS_IDENTICAL                                                 ~5, <true>
         10      > JMPNZ                                                        ~3, ->18
         11    > > JMP                                                          ->12
         12    > > MATCH_ERROR                                                  <true>
   10    13    >   INIT_FCALL                                                   'doprint'
         14        SEND_VAL                                                     'zero'
         15        DO_FCALL                                          0  $6      
         16        QM_ASSIGN                                            ~7      $6
         17      > JMP                                                          ->23
   11    18    >   INIT_FCALL                                                   'doprint'
         19        SEND_VAL                                                     'one'
         20        DO_FCALL                                          0  $8      
         21        QM_ASSIGN                                            ~7      $8
         22      > JMP                                                          ->23
         23    >   FREE                                                         ~7
   12    24      > RETURN                                                       1

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

End of function doprint

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.61 ms | 1095 KiB | 16 Q