3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "blah 2015 yar"; $pos = strpos($string, "20"); $year = substr($string, $pos, 4); $end_year = "12/31/" . $year; echo $end_year; $end_time = new DateTime($end_year); var_dump($end_time); $start_time = new DateTime(); $diff = $end_time->diff($start_time); var_dump($diff); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VfZks
function name:  (null)
number of ops:  33
compiled vars:  !0 = $string, !1 = $pos, !2 = $year, !3 = $end_year, !4 = $end_time, !5 = $start_time, !6 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'blah+2015+yar'
    3     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '20'
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
    4     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 4
         10        DO_ICALL                                         $10     
         11        ASSIGN                                                   !2, $10
    6    12        CONCAT                                           ~12     '12%2F31%2F', !2
         13        ASSIGN                                                   !3, ~12
    7    14        ECHO                                                     !3
    8    15        NEW                                              $14     'DateTime'
         16        SEND_VAR_EX                                              !3
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !4, $14
    9    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                                 
   10    22        NEW                                              $18     'DateTime'
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !5, $18
   11    25        INIT_METHOD_CALL                                         !4, 'diff'
         26        SEND_VAR_EX                                              !5
         27        DO_FCALL                                      0  $21     
         28        ASSIGN                                                   !6, $21
   12    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !6
         31        DO_ICALL                                                 
   15    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.08 ms | 1396 KiB | 19 Q