3v4l.org

run code in 300+ PHP versions simultaneously
<?php $block = '2*'; $pos = strpos($block, '*'); if ($pos !== false) { $num = substr($block, 0, $pos); } $min = str_pad($num,3,'0'); $max = min(255,str_pad($num,3,'9')); echo $min.'-'.$max;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/gXopN
function name:  (null)
number of ops:  34
compiled vars:  !0 = $block, !1 = $pos, !2 = $num, !3 = $min, !4 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2%2A'
    3     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2A'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    4     6        TYPE_CHECK                                  1018          !1
          7      > JMPZ                                                     ~8, ->14
    5     8    >   INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !2, $9
    8    14    >   INIT_FCALL                                               'str_pad'
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 3
         17        SEND_VAL                                                 '0'
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !3, $11
   10    20        INIT_FCALL                                               'min'
         21        SEND_VAL                                                 255
         22        INIT_FCALL                                               'str_pad'
         23        SEND_VAR                                                 !2
         24        SEND_VAL                                                 3
         25        SEND_VAL                                                 '9'
         26        DO_ICALL                                         $13     
         27        SEND_VAR                                                 $13
         28        DO_ICALL                                         $14     
         29        ASSIGN                                                   !4, $14
   11    30        CONCAT                                           ~16     !3, '-'
         31        CONCAT                                           ~17     ~16, !4
         32        ECHO                                                     ~17
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.79 ms | 1396 KiB | 21 Q