3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ReformatPhoneNumber($number) { $validChars = array(' ', '-'); echo substr($number, 0, 1) . PHP_EOL . substr(strlen($number) - 1, 1); } echo ReformatPhoneNumber('012-345 69');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RrYH2
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'reformatphonenumber'
          1        SEND_VAL                                                 '012-345+69'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function reformatphonenumber:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RrYH2
function name:  ReformatPhoneNumber
number of ops:  17
compiled vars:  !0 = $number, !1 = $validChars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $3      
          7        CONCAT                                           ~4      $3, '%0A'
          8        INIT_FCALL                                               'substr'
          9        STRLEN                                           ~5      !0
         10        SUB                                              ~6      ~5, 1
         11        SEND_VAL                                                 ~6
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $7      
         14        CONCAT                                           ~8      ~4, $7
         15        ECHO                                                     ~8
    8    16      > RETURN                                                   null

End of function reformatphonenumber

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.74 ms | 1398 KiB | 16 Q