3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = '+421917982116'; $haveNumberPlus = strpos($number, '+'); var_dump($haveNumberPlus); if (!$haveNumberPlus) { 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 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/cMLQg
function name:  (null)
number of ops:  29
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
    5     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    6     9        BOOL_NOT                                         ~6      !1
         10      > JMPZ                                                     ~6, ->19
    7    11    >   INIT_FCALL                                               'number_format'
         12        CAST                                          4  ~7      !0
         13        SEND_VAL                                                 ~7
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 '+'
         16        SEND_VAL                                                 '+'
         17        DO_ICALL                                         $8      
         18        ECHO                                                     $8
   10    19    >   INIT_FCALL                                               'number_format'
         20        CAST                                          4  ~9      !0
         21        SEND_VAL                                                 ~9
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 '+'
         24        SEND_VAL                                                 '+'
         25        DO_ICALL                                         $10     
         26        CONCAT                                           ~11     '%2B', $10
         27        ECHO                                                     ~11
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.21 ms | 1395 KiB | 19 Q