3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = '+421917982116'; $haveNumberPlus = strpos($number, '+'); if ($haveNumberPlus === false) { echo number_format((int)$number, 0, ' ', ' '); } echo '+' . number_format((int)$number, 0, ' ', ' ');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/O21DC
function name:  (null)
number of ops:  26
compiled vars:  !0 = $number, !1 = $haveNumberPlus
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2B421917982116'
    4     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2B'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    6     6        TYPE_CHECK                                    4          !1
          7      > JMPZ                                                     ~5, ->16
    7     8    >   INIT_FCALL                                               'number_format'
          9        CAST                                          4  ~6      !0
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 '+'
         13        SEND_VAL                                                 '+'
         14        DO_ICALL                                         $7      
         15        ECHO                                                     $7
   10    16    >   INIT_FCALL                                               'number_format'
         17        CAST                                          4  ~8      !0
         18        SEND_VAL                                                 ~8
         19        SEND_VAL                                                 0
         20        SEND_VAL                                                 '+'
         21        SEND_VAL                                                 '+'
         22        DO_ICALL                                         $9      
         23        CONCAT                                           ~10     '%2B', $9
         24        ECHO                                                     ~10
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.44 ms | 1395 KiB | 17 Q