PHP StdClass Code Examples

This page contains top rated real world PHP examples of StdClass extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: StdClassTest.php Project: colonB/Copycat
0
 /**
  * Tests __call
  * @covers \Copycat\Standard\StdClass::__call()
  */
 public function testCall()
 {
     $class = new StdClass();
     $class->test = function () {
         return StdClassTest::TEST;
     };
     /** @noinspection PhpUndefinedMethodInspection */
     $this->assertEquals(self::TEST, $class->test());
     try {
         $caught = false;
         /** @noinspection PhpUndefinedMethodInspection */
         $class->testTest();
     } catch (Exception $exception) {
         $caught = true;
         $this->assertEquals('Method testTest is undefined', $exception->getMessage());
     }
     if (!$caught) {
         $this->fail('Exception was not caught');
     }
 }
Example #2
Show file File: object.php Project: kuznetsovatatjana/8.tund_II_ruhm
0
<?php

$user = new StdClass();
$user->name = "Romil";
$user->gender = "male";
var_dump($user);
$user->name = "Juku";
echo "<br>";
echo $user->name;
//error
$error = new StdClass();
$error->id = 0;
$error->message("Unknown error");
$error->id = 3;
$error->message("Wrong password");
Example #3
Show file File: issue-19.php Project: phracek/php-mode
0
 public function something()
 {
     $object = new StdClass();
     $object->call()->something();
 }
Example #4
Show file File: courses-details.php Project: akshayxhtmljunkies/brownglock
0
        exit;
    }
}
$unit_id = '';
$course_id = '';
if (isset($_GET['course_id']) && is_numeric($_GET['course_id'])) {
    $course_id = (int) $_GET['course_id'];
}
if (isset($_GET['unit_id']) && is_numeric($_GET['unit_id'])) {
    $unit_id = (int) $_GET['unit_id'];
}
$course = new Course($course_id);
if (empty($course)) {
    $course = new StdClass();
} else {
    $course_object = $course->get_course();
}
$units = $course->get_units();
$students_count = $course->get_number_of_students();
?>

<div class="wrap nosubsub course-details cp-wrap">
	<div class="icon32" id="icon-themes"><br></div>
	<?php 
$tab = isset($_GET['tab']) ? $_GET['tab'] : '';
if (empty($tab)) {
    $tab = 'overview';
}
?>

	<h2><?php 
if ($course_id == '') {
Example #5
Show file File: Dynamiccall.01.php Project: exakat/exakat
0
<?php

normalFunctionCall();
\NSedFunctionCall();
\a\b\NSedFunctionCall();
$variableFunctionCall();
$arrayFunctionCall[1]();
$object->methodFunctionCall();
StdClass::staticMethodFunctionCall();
Example #6
Show file File: Recursive.03.php Project: exakat/exakat
0
function nonRecursive2($x)
{
    StdClass::nonRecursive2();
}
Example #7
Show file File: OdmReminderRepository.php Project: kh411d/laravel-odm-auth
0
 /**
  * Determine if the reminder has expired.
  *
  * @param  StdClass  $reminder
  * @return bool
  */
 protected function reminderExpired($reminder)
 {
     $createdPlusHour = $reminder->getCreatedAt()->getTimestamp() + 216000;
     return $createdPlusHour < $this->getCurrentTime();
 }