3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num = 012014; $num = strval($num); echo $num."-"; echo substr($num, 0, $num < 0 ? 3 : 2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5FSZ7
function name:  (null)
number of ops:  17
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5132
    4     1        CAST                                          6  ~2      !0
          2        ASSIGN                                                   !0, ~2
    5     3        CONCAT                                           ~4      !0, '-'
          4        ECHO                                                     ~4
    6     5        INIT_FCALL                                               'substr'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 0
          8        IS_SMALLER                                               !0, 0
          9      > JMPZ                                                     ~5, ->12
         10    >   QM_ASSIGN                                        ~6      3
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~6      2
         13    >   SEND_VAL                                                 ~6
         14        DO_ICALL                                         $7      
         15        ECHO                                                     $7
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.16 ms | 1394 KiB | 15 Q