PHP 8.5.0 Beta 1 available for testing

Voting

: max(three, one)?
(Example: nine)

The Note You're Voting On

greaties at ghvernuft dot nl
10 months ago
Protected and private properties are ignored,
when json_encoding a class instance.
The snippet

<?php
class Example
{
private
$privateprop = "private property";
protected
$protectedprop = "protected property";
public
$publicprop = "public property";
}
echo
json_encode(new Example);
?>

only returns
{"publicprop":"public property"}

<< Back to user notes page

To Top