3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format($n){ return substr($n, 0, 5)."-".substr($n,5,7)."-".substr($n,12,1); } print format("12343");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5g0LL
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'format'
          1        SEND_VAL                                                 '12343'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function format:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5g0LL
function name:  format
number of ops:  22
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 5
          5        DO_ICALL                                         $1      
          6        CONCAT                                           ~2      $1, '-'
          7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 5
         10        SEND_VAL                                                 7
         11        DO_ICALL                                         $3      
         12        CONCAT                                           ~4      ~2, $3
         13        CONCAT                                           ~5      ~4, '-'
         14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 12
         17        SEND_VAL                                                 1
         18        DO_ICALL                                         $6      
         19        CONCAT                                           ~7      ~5, $6
         20      > RETURN                                                   ~7
    5    21*     > RETURN                                                   null

End of function format

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.02 ms | 1398 KiB | 16 Q