/ LJCPHPCodeDoc / LJCCommonLib / Output / LogObject


Parameters
$lineNumber - The debug line number.
$valueName - The value name.
$value - The value.
$output - Indicates if value is output.

Syntax

PHP
public function LogObject(int $lineNumber, string $valueName, $value
, bool $isObject = true, bool $output = true): string

Outputs the object text.

Example

PHP
 // Outputs the object debug text.
 private static function OutputLogObject()
 {
   $className = "CommonTest";
   $methodName = "OutputLogObject";
   $valueName = "\$value";
   $value = "Test";
   $output = LJC::OutputLogObject(__line__, $className, $methodName, $valueName
     , $value, isObject: false, output: false);
 
   // output:
   //
   // CommonTest.OutputLogObject $value: Test
 
   $value = (object) [
     "Name" => "John",
     "Number" => 5,
   ];
   $output = LJC::OutputLogObject(__line__, $className, $methodName, $valueName
     , $value, output: false);
 
   // output:
   //
   // CommonTest.OutputLogObject $value:
   // stdClass Object
   // (
   //     [Name] => John
   //     [Number] => 5
   // )
 }

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.