3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Post { public $title; public $content; function hasContent() { return isset($this->content); } } $post = new Post; $post->title = 'mon titre'; $post->content = 'Mon contenu'; if ($post->hasContent()) { echo $post->content; } else { echo 'pas de contenu'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XtjKP
function name:  (null)
number of ops:  15
compiled vars:  !0 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Post'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        ASSIGN_OBJ                                               !0, 'title'
          4        OP_DATA                                                  'mon+titre'
   19     5        ASSIGN_OBJ                                               !0, 'content'
          6        OP_DATA                                                  'Mon+contenu'
   22     7        INIT_METHOD_CALL                                         !0, 'hasContent'
          8        DO_FCALL                                      0  $6      
          9      > JMPZ                                                     $6, ->13
   23    10    >   FETCH_OBJ_R                                      ~7      !0, 'content'
         11        ECHO                                                     ~7
         12      > JMP                                                      ->14
   26    13    >   ECHO                                                     'pas+de+contenu'
   27    14    > > RETURN                                                   1

Class Post:
Function hascontent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XtjKP
function name:  hasContent
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ISSET_ISEMPTY_PROP_OBJ                           ~0      'content'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function hascontent

End of class Post.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.78 ms | 1394 KiB | 13 Q