3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * */ class CardCommentObject extends eZPersistentObject { /** * @param array $row */ public function __construct($row) { parent::eZPersistentObject($row); } public static function definition() { static $def = array( 'fields' => array( 'id' => array( 'name' => 'id', 'datatype' => 'integer', 'default' => 0, 'required' => true), 'node_id' => array( 'name' => 'node_id', 'datatype' => 'integer', 'default' => '', 'required' => true), 'comment' => array( 'name' => 'comment', 'datatype' => 'string', 'default' => '', 'required' => true) ), 'keys' => array('id'), 'increment_key' => 'id', 'class_name' => 'CardCommentObject', 'name' => 'CardComments'); return $def; } public static function create( array $row = array() ) { $object = new self( $row ); return $object; } public static function getComments($conds=null,$sorts=array( 'node_id' => 'asc') ,$limit = null,$field_filters = null,$custom_conds = null,$asObject = false,$grouping = false, $custom_fields = null, $custom_tables = null){ $objectList = eZPersistentObject::fetchObjectList( self::definition(), $field_filters, $conds , $sorts, $limit , $asObject , $grouping , $custom_fields , $custom_tables , $custom_conds ); return count( $objectList ) > 0 ? $objectList[0]['comment'] : false; } public static function updateCardComments($node_id,$comment){ $db = eZDB::instance(); $cardComment = eZPersistentObject::fetchObject(self::definition(), null, array('node_id'=>$db->escapeString($node_id))); if (is_null($cardComment)){ $cardComment = self::create(array('node_id'=>$db->escapeString($node_id))); } $cardComment->comment = $db->escapeString($comment); $cardComment->store(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LC53Y
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'cardcommentobject', 'ezpersistentobject'
   73     1      > RETURN                                                   1

Class CardCommentObject:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LC53Y
function name:  __construct
number of ops:  5
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_STATIC_METHOD_CALL                                  'eZPersistentObject'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   13     4      > RETURN                                                   null

End of function __construct

Function definition:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LC53Y
function name:  definition
number of ops:  3
compiled vars:  !0 = $def
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   BIND_STATIC                                              !0
   39     1      > RETURN                                                   !0
   40     2*     > RETURN                                                   null

End of function definition

Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LC53Y
function name:  create
number of ops:  7
compiled vars:  !0 = $row, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   RECV_INIT                                        !0      <array>
   44     1        NEW                          self                $2      
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $2
   45     5      > RETURN                                                   !1
   46     6*     > RETURN                                                   null

End of function create

Function getcomments:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LC53Y
function name:  getComments
number of ops:  34
compiled vars:  !0 = $conds, !1 = $sorts, !2 = $limit, !3 = $field_filters, !4 = $custom_conds, !5 = $asObject, !6 = $grouping, !7 = $custom_fields, !8 = $custom_tables, !9 = $objectList
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      <array>
          2        RECV_INIT                                        !2      null
          3        RECV_INIT                                        !3      null
          4        RECV_INIT                                        !4      null
          5        RECV_INIT                                        !5      <false>
          6        RECV_INIT                                        !6      <false>
          7        RECV_INIT                                        !7      null
          8        RECV_INIT                                        !8      null
   49     9        INIT_STATIC_METHOD_CALL                                  'eZPersistentObject', 'fetchObjectList'
         10        INIT_STATIC_METHOD_CALL                                  'definition'
         11        DO_FCALL                                      0  $10     
         12        SEND_VAR_NO_REF_EX                                       $10
         13        SEND_VAR_EX                                              !3
         14        SEND_VAR_EX                                              !0
         15        SEND_VAR_EX                                              !1
         16        SEND_VAR_EX                                              !2
         17        SEND_VAR_EX                                              !5
         18        SEND_VAR_EX                                              !6
         19        SEND_VAR_EX                                              !7
         20        SEND_VAR_EX                                              !8
         21        SEND_VAR_EX                                              !4
         22        DO_FCALL                                      0  $11     
         23        ASSIGN                                                   !9, $11
   60    24        COUNT                                            ~13     !9
         25        IS_SMALLER                                               0, ~13
         26      > JMPZ                                                     ~14, ->31
         27    >   FETCH_DIM_R                                      ~15     !9, 0
         28        FETCH_DIM_R                                      ~16     ~15, 'comment'
         29        QM_ASSIGN                                        ~17     ~16
         30      > JMP                                                      ->32
         31    >   QM_ASSIGN                                        ~17     <false>
         32    > > RETURN                                                   ~17
   61    33*     > RETURN                                                   null

End of function getcomments

Function updatecardcomments:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 27
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/LC53Y
function name:  updateCardComments
number of ops:  35
compiled vars:  !0 = $node_id, !1 = $comment, !2 = $db, !3 = $cardComment
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   64     2        INIT_STATIC_METHOD_CALL                                  'eZDB', 'instance'
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !2, $4
   65     5        INIT_STATIC_METHOD_CALL                                  'eZPersistentObject', 'fetchObject'
          6        INIT_STATIC_METHOD_CALL                                  'definition'
          7        DO_FCALL                                      0  $6      
          8        SEND_VAR_NO_REF_EX                                       $6
          9        SEND_VAL_EX                                              null
         10        INIT_METHOD_CALL                                         !2, 'escapeString'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0  $7      
         13        INIT_ARRAY                                       ~8      $7, 'node_id'
         14        SEND_VAL_EX                                              ~8
         15        DO_FCALL                                      0  $9      
         16        ASSIGN                                                   !3, $9
   66    17        TYPE_CHECK                                    2          !3
         18      > JMPZ                                                     ~11, ->27
   67    19    >   INIT_STATIC_METHOD_CALL                                  'create'
         20        INIT_METHOD_CALL                                         !2, 'escapeString'
         21        SEND_VAR_EX                                              !0
         22        DO_FCALL                                      0  $12     
         23        INIT_ARRAY                                       ~13     $12, 'node_id'
         24        SEND_VAL                                                 ~13
         25        DO_FCALL                                      0  $14     
         26        ASSIGN                                                   !3, $14
   69    27    >   INIT_METHOD_CALL                                         !2, 'escapeString'
         28        SEND_VAR_EX                                              !1
         29        DO_FCALL                                      0  $17     
         30        ASSIGN_OBJ                                               !3, 'comment'
         31        OP_DATA                                                  $17
   70    32        INIT_METHOD_CALL                                         !3, 'store'
         33        DO_FCALL                                      0          
   71    34      > RETURN                                                   null

End of function updatecardcomments

End of class CardCommentObject.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.39 ms | 1403 KiB | 13 Q