3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = "123@456asdf7896"; $numbers = preg_replace('/\D/', '', $data); ?> $phone_num = '('.substr($numbers, 0, 3).') '.substr($numbers, 3, 3).'-'.substr($numbers,6); echo $phone_num;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ASZQ8
function name:  (null)
number of ops:  9
compiled vars:  !0 = $data, !1 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '123%40456asdf7896'
    3     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5CD%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    4     7        ECHO                                                     '++++%24phone_num+%3D+%27%28%27.substr%28%24numbers%2C+0%2C+3%29.%27%29+%27.substr%28%24numbers%2C+3%2C+3%29.%27-%27.substr%28%24numbers%2C6%29%3B+%0A%0A++++echo+%24phone_num%3B'
    6     8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.04 ms | 1394 KiB | 15 Q