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(); } }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "eZPersistentObject" not found in /in/LC53Y:5 Stack trace: #0 {main} thrown in /in/LC53Y on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
53.61 ms | 401 KiB | 8 Q