3v4l.org

run code in 500+ PHP versions simultaneously
<?php class UrlConcrete { /** * @param DateTimeInterface|DateTime|null $lastmod * * @return UrlConcrete */ public function setLastmod($lastmod = null) { if (!($lastmod instanceof \DateTimeInterface || $lastmod instanceof \DateTime)) { $typePassed = is_object($lastmod) ? \get_class($lastmod) : \gettype($lastmod); if (\PHP_MAJOR_VERSION >= 7) { throw new \TypeError('Argument 1 passed to ' . __METHOD__ . "() must be an instance of DateTimeInterface, '$typePassed' given"); } else { \trigger_error('Argument 1 passed to ' . __METHOD__ . "() must be an instance of DateTime, '$typePassed' given", E_USER_ERROR); return $this; } } $this->lastmod = $lastmod; return $this; } } $x = new UrlConcrete(); $x->setLastmod(new \DateTime()); $x->setLastmod(new stdclass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NHDnA
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   NEW                                                  $1      'UrlConcrete'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   31     3        INIT_METHOD_CALL                                             !0, 'setLastmod'
          4        NEW                                                  $4      'DateTime'
          5        DO_FCALL                                          0          
          6        SEND_VAR_NO_REF_EX                                           $4
          7        DO_FCALL                                          0          
   32     8        INIT_METHOD_CALL                                             !0, 'setLastmod'
          9        NEW                                                  $7      'stdclass'
         10        DO_FCALL                                          0          
         11        SEND_VAR_NO_REF_EX                                           $7
         12        DO_FCALL                                          0          
         13      > RETURN                                                       1

Class UrlConcrete:
Function setlastmod:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 35
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
Branch analysis from position: 25
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/NHDnA
function name:  setLastmod
number of ops:  40
compiled vars:  !0 = $lastmod, !1 = $typePassed
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV_INIT                                            !0      null
   12     1        INSTANCEOF                                           ~2      !0, 'DateTimeInterface'
          2      > JMPNZ_EX                                             ~2      ~2, ->5
          3    >   INSTANCEOF                                           ~3      !0, 'DateTime'
          4        BOOL                                                 ~2      ~3
          5    >   BOOL_NOT                                             ~4      ~2
          6      > JMPZ                                                         ~4, ->35
   13     7    >   TYPE_CHECK                                      256          !0
          8      > JMPZ                                                         ~5, ->12
          9    >   GET_CLASS                                            ~6      !0
         10        QM_ASSIGN                                            ~7      ~6
         11      > JMP                                                          ->14
         12    >   GET_TYPE                                             ~8      !0
         13        QM_ASSIGN                                            ~7      ~8
         14    >   ASSIGN                                                       !1, ~7
   15    15      > JMPZ                                                         <true>, ->25
   16    16    >   NEW                                                  $10     'TypeError'
         17        ROPE_INIT                                         3  ~12     '%28%29+must+be+an+instance+of+DateTimeInterface%2C+%27'
         18        ROPE_ADD                                          1  ~12     ~12, !1
         19        ROPE_END                                          2  ~11     ~12, '%27+given'
         20        CONCAT                                               ~14     'Argument+1+passed+to+UrlConcrete%3A%3AsetLastmod', ~11
         21        SEND_VAL_EX                                                  ~14
         22        DO_FCALL                                          0          
         23      > THROW                                             0          $10
   15    24*       JMP                                                          ->35
   18    25    >   INIT_FCALL                                                   'trigger_error'
         26        ROPE_INIT                                         3  ~17     '%28%29+must+be+an+instance+of+DateTime%2C+%27'
         27        ROPE_ADD                                          1  ~17     ~17, !1
         28        ROPE_END                                          2  ~16     ~17, '%27+given'
         29        CONCAT                                               ~19     'Argument+1+passed+to+UrlConcrete%3A%3AsetLastmod', ~16
         30        SEND_VAL                                                     ~19
         31        SEND_VAL                                                     256
         32        DO_ICALL                                                     
   20    33        FETCH_THIS                                           ~21     
         34      > RETURN                                                       ~21
   24    35    >   ASSIGN_OBJ                                                   'lastmod'
         36        OP_DATA                                                      !0
   26    37        FETCH_THIS                                           ~23     
         38      > RETURN                                                       ~23
   27    39*     > RETURN                                                       null

End of function setlastmod

End of class UrlConcrete.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.95 ms | 3263 KiB | 14 Q