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++) { // {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 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 25
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 25
Branch analysis from position: 43
Branch analysis from position: 25
filename:       /in/kDGWA
function name:  (null)
number of ops:  44
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                                                      ->40
   27    25    >   ASSIGN                                                   !6, '%2F+%28%5Cd%2B%29%28%5Cw%2B%29%2Fi'
   28    26        ASSIGN                                                   !7, '%25%25%25'
   29    27        INIT_FCALL                                               'preg_replace'
         28        SEND_VAR                                                 !6
         29        SEND_VAR                                                 !7
         30        FETCH_DIM_R                                      ~24     !4, !5
         31        SEND_VAL                                                 ~24
         32        DO_ICALL                                         $25     
         33        ECHO                                                     $25
   32    34        CONCAT                                           ~26     !5, '+'
         35        FETCH_DIM_R                                      ~27     !4, !5
         36        CONCAT                                           ~28     ~26, ~27
         37        CONCAT                                           ~29     ~28, '%0A'
         38        ECHO                                                     ~29
   18    39        PRE_INC                                                  !5
         40    >   COUNT                                            ~31     !4
         41        IS_SMALLER                                               !5, ~31
         42      > JMPNZ                                                    ~32, ->25
   34    43    > > RETURN                                                   1

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