3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = '1234567890'; echo preg_replace('/\d{3}\K/', '-', $string, 2); echo "\n---\n"; vprintf('%s-%s-%s', sscanf($string, '%3s%3s%4s')); echo "\n---\n"; echo implode('-', sscanf($string, '%3s%3s%4s'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gSJje
function name:  (null)
number of ops:  25
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '1234567890'
    5     1        INIT_FCALL                                                   'preg_replace'
          2        SEND_VAL                                                     '%2F%5Cd%7B3%7D%5CK%2F'
          3        SEND_VAL                                                     '-'
          4        SEND_VAR                                                     !0
          5        SEND_VAL                                                     2
          6        DO_ICALL                                             $2      
          7        ECHO                                                         $2
    7     8        ECHO                                                         '%0A---%0A'
    9     9        INIT_FCALL                                                   'vprintf'
         10        SEND_VAL                                                     '%25s-%25s-%25s'
         11        INIT_FCALL                                                   'sscanf'
         12        SEND_VAR                                                     !0
         13        SEND_VAL                                                     '%253s%253s%254s'
         14        DO_ICALL                                             $3      
         15        SEND_VAR                                                     $3
         16        DO_ICALL                                                     
   11    17        ECHO                                                         '%0A---%0A'
   13    18        INIT_FCALL                                                   'sscanf'
         19        SEND_VAR                                                     !0
         20        SEND_VAL                                                     '%253s%253s%254s'
         21        DO_ICALL                                             $5      
         22        FRAMELESS_ICALL_2                implode             ~6      '-', $5
         23        ECHO                                                         ~6
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.96 ms | 1862 KiB | 16 Q