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])) echo 'found num!'; // {print_r($matches);} {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 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 25
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 25
Branch analysis from position: 47
Branch analysis from position: 25
Branch analysis from position: 32
filename:       /in/SmFD3
function name:  (null)
number of ops:  48
compiled vars:  !0 = $myS, !1 = $myX, !2 = $myF, !3 = $str, !4 = $newCeva, !5 = $i
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  $7      
          4        ASSIGN                                                   !1, $7
   10     5        CONCAT                                           ~9      'hei', !1
          6        CONCAT                                           ~10     ~9, '%0A'
          7        ECHO                                                     ~10
   12     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'd+m+Y+H%3Ai'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !2, $11
   13    13        CONCAT                                           ~13     'heiF', !2
         14        CONCAT                                           ~14     ~13, '%0A'
         15        ECHO                                                     ~14
   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                                         $16     
         21        ASSIGN                                                   !4, $16
   17    22        ASSIGN                                                   !5, 0
   18    23        ASSIGN                                                   !5, 0
         24      > JMP                                                      ->44
   23    25    >   INIT_FCALL                                               'preg_match'
         26        SEND_VAL                                                 '%21%5Cd%2B%21'
         27        FETCH_DIM_R                                      ~20     !4, !5
         28        SEND_VAL                                                 ~20
         29        DO_ICALL                                         $21     
         30      > JMPZ                                                     $21, ->32
   24    31    >   ECHO                                                     'found+num%21'
   26    32    >   INIT_FCALL                                               'preg_replace'
         33        SEND_VAL                                                 '%2F%5B%5E0-9%5D%2F'
         34        SEND_VAL                                                 '%25%25'
         35        FETCH_DIM_R                                      ~22     !4, !5
         36        SEND_VAL                                                 ~22
         37        DO_ICALL                                                 
   27    38        CONCAT                                           ~24     !5, '+'
         39        FETCH_DIM_R                                      ~25     !4, !5
         40        CONCAT                                           ~26     ~24, ~25
         41        CONCAT                                           ~27     ~26, '%0A'
         42        ECHO                                                     ~27
   18    43        PRE_INC                                                  !5
         44    >   COUNT                                            ~29     !4
         45        IS_SMALLER                                               !5, ~29
         46      > JMPNZ                                                    ~30, ->25
   29    47    > > RETURN                                                   1

Function fullstrtotime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SmFD3
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:
177.84 ms | 1403 KiB | 26 Q