3v4l.org

run code in 300+ PHP versions simultaneously
<?php $print = "50 days"; var_export( strstr($print, ',', true) ); echo "\n"; var_export( preg_replace('/,.*/', '', $print) ); echo "\n"; var_export( strtok($print, ",") ); echo "\n"; var_export( explode(',', $print, 2)[0] ); echo "\n"; var_export( sscanf($print, '%[^,]')[0] ?? $print );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kv7Fs
function name:  (null)
number of ops:  48
compiled vars:  !0 = $print
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '50+days'
    5     1        INIT_FCALL                                               'var_export'
    6     2        INIT_FCALL                                               'strstr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%2C'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
    9     9        ECHO                                                     '%0A'
   11    10        INIT_FCALL                                               'var_export'
   12    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2F%2C.%2A%2F'
         13        SEND_VAL                                                 ''
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
   15    18        ECHO                                                     '%0A'
   17    19        INIT_FCALL                                               'var_export'
   18    20        INIT_FCALL                                               'strtok'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 '%2C'
         23        DO_ICALL                                         $6      
         24        SEND_VAR                                                 $6
         25        DO_ICALL                                                 
   21    26        ECHO                                                     '%0A'
   23    27        INIT_FCALL                                               'var_export'
   24    28        INIT_FCALL                                               'explode'
         29        SEND_VAL                                                 '%2C'
         30        SEND_VAR                                                 !0
         31        SEND_VAL                                                 2
         32        DO_ICALL                                         $8      
         33        FETCH_DIM_R                                      ~9      $8, 0
         34        SEND_VAL                                                 ~9
         35        DO_ICALL                                                 
   27    36        ECHO                                                     '%0A'
   29    37        INIT_FCALL                                               'var_export'
   30    38        INIT_FCALL                                               'sscanf'
         39        SEND_VAR                                                 !0
         40        SEND_VAL                                                 '%25%5B%5E%2C%5D'
         41        DO_ICALL                                         $11     
         42        FETCH_DIM_IS                                     ~12     $11, 0
         43        COALESCE                                         ~13     ~12
         44        QM_ASSIGN                                        ~13     !0
         45        SEND_VAL                                                 ~13
         46        DO_ICALL                                                 
   31    47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.78 ms | 1400 KiB | 25 Q