3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mobile = '01234567'; $zero_lead = "/^01/"; $country_code = "44"; $phone = preg_replace($zero_lead, $country_code, $mobile, -1, $count); $accountNumber = $count ? '' : $mobile; $post_data = array( 'phone' => $phone, 'accountNumber' => $accountNumber, ); echo json_encode($post_data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dn6Zh
function name:  (null)
number of ops:  24
compiled vars:  !0 = $mobile, !1 = $zero_lead, !2 = $country_code, !3 = $phone, !4 = $count, !5 = $accountNumber, !6 = $post_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '01234567'
    5     1        ASSIGN                                                   !1, '%2F%5E01%2F'
    6     2        ASSIGN                                                   !2, '44'
    9     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 -1
          8        SEND_REF                                                 !4
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !3, $10
   10    11      > JMPZ                                                     !4, ->14
         12    >   QM_ASSIGN                                        ~12     ''
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~12     !0
         15    >   ASSIGN                                                   !5, ~12
   13    16        INIT_ARRAY                                       ~14     !3, 'phone'
   14    17        ADD_ARRAY_ELEMENT                                ~14     !5, 'accountNumber'
   12    18        ASSIGN                                                   !6, ~14
   17    19        INIT_FCALL                                               'json_encode'
         20        SEND_VAR                                                 !6
         21        DO_ICALL                                         $16     
         22        ECHO                                                     $16
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.8 ms | 1395 KiB | 17 Q