3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fullstrtotime ($time) { return strtotime(str_replace(array(" at"), "", $time)); } $myS = "tomorrow at 5PM"; $myX = fullstrtotime($myS); echo "hei" . $myX . "\n"; $myF = date('d m Y H:i',$myX) ; echo "heiF" . $myF . "\n"; $str = "Dinner at 5pm at Shanghai Restaurant"; $newCeva = explode(" ",$str); $i = 0; for($i=0;$i<count($newCeva);$i++) { if(preg_match('!\d+!', $newCeva[$i])){ // {print_r($matches);} $pattern = '/ (\d+)(\w+)/i'; $replacement = ' '; echo preg_replace($pattern, $replacement, $newCeva[$i]); // {preg_replace('/[^0-9]/', '%%', $newCeva[$i]);} } echo $i . " " . $newCeva[$i] . "\n"; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 25
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 40
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 25
Branch analysis from position: 49
Branch analysis from position: 25
Branch analysis from position: 40
filename:       /in/YoWoS
function name:  (null)
number of ops:  50
compiled vars:  !0 = $myS, !1 = $myX, !2 = $myF, !3 = $str, !4 = $newCeva, !5 = $i, !6 = $pattern, !7 = $replacement
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'tomorrow+at+5PM'
    9     1        INIT_FCALL                                               'fullstrtotime'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $9      
          4        ASSIGN                                                   !1, $9
   10     5        CONCAT                                           ~11     'hei', !1
          6        CONCAT                                           ~12     ~11, '%0A'
          7        ECHO                                                     ~12
   12     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'd+m+Y+H%3Ai'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $13     
         12        ASSIGN                                                   !2, $13
   13    13        CONCAT                                           ~15     'heiF', !2
         14        CONCAT                                           ~16     ~15, '%0A'
         15        ECHO                                                     ~16
   15    16        ASSIGN                                                   !3, 'Dinner+at+5pm+at+Shanghai+Restaurant'
   16    17        INIT_FCALL                                               'explode'
         18        SEND_VAL                                                 '+'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $18     
         21        ASSIGN                                                   !4, $18
   17    22        ASSIGN                                                   !5, 0
   18    23        ASSIGN                                                   !5, 0
         24      > JMP                                                      ->46
   23    25    >   INIT_FCALL                                               'preg_match'
         26        SEND_VAL                                                 '%21%5Cd%2B%21'
         27        FETCH_DIM_R                                      ~22     !4, !5
         28        SEND_VAL                                                 ~22
         29        DO_ICALL                                         $23     
         30      > JMPZ                                                     $23, ->40
   27    31    >   ASSIGN                                                   !6, '%2F+%28%5Cd%2B%29%28%5Cw%2B%29%2Fi'
   28    32        ASSIGN                                                   !7, '+'
   29    33        INIT_FCALL                                               'preg_replace'
         34        SEND_VAR                                                 !6
         35        SEND_VAR                                                 !7
         36        FETCH_DIM_R                                      ~26     !4, !5
         37        SEND_VAL                                                 ~26
         38        DO_ICALL                                         $27     
         39        ECHO                                                     $27
   32    40    >   CONCAT                                           ~28     !5, '+'
         41        FETCH_DIM_R                                      ~29     !4, !5
         42        CONCAT                                           ~30     ~28, ~29
         43        CONCAT                                           ~31     ~30, '%0A'
         44        ECHO                                                     ~31
   18    45        PRE_INC                                                  !5
         46    >   COUNT                                            ~33     !4
         47        IS_SMALLER                                               !5, ~33
         48      > JMPNZ                                                    ~34, ->25
   34    49    > > RETURN                                                   1

Function fullstrtotime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YoWoS
function name:  fullstrtotime
number of ops:  11
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'strtotime'
          2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9      > RETURN                                                   $2
    5    10*     > RETURN                                                   null

End of function fullstrtotime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.57 ms | 1403 KiB | 26 Q