3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sub_string($string, $start, $length) { $result = substr($string,$start,$length); return $result; } $test_string = '1978-02-16'; $year = sub_string($test_string,0,4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gGp3B
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test_string, !1 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, '1978-02-16'
    7     1        INIT_FCALL                                               'sub_string'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 4
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !1, $3
          7      > RETURN                                                   1

Function sub_string:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gGp3B
function name:  sub_string
number of ops:  11
compiled vars:  !0 = $string, !1 = $start, !2 = $length, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    3     3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !3, $4
    4     9      > RETURN                                                   !3
    5    10*     > RETURN                                                   null

End of function sub_string

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.96 ms | 1397 KiB | 16 Q