1--TEST-- 2Test that the mixed property type accepts any kind of value in strict mode 3--FILE-- 4<?php 5declare(strict_types=1); 6 7class Foo 8{ 9 public mixed $property1; 10 public mixed $property2 = null; 11 public mixed $property3 = false; 12 public mixed $property4 = true; 13 public mixed $property5 = 1; 14 public mixed $property6 = 3.14; 15 public mixed $property7 = "foo"; 16 public mixed $property8 = []; 17 public mixed $property9; 18 19 public function __construct() 20 { 21 $this->property9 = fopen(__FILE__, "r"); 22 $this->property9 = new stdClass(); 23 } 24} 25 26$foo = new Foo(); 27 28try { 29 $foo->property1; 30} catch (Error $exception) { 31 echo $exception->getMessage() . "\n"; 32} 33 34?> 35--EXPECT-- 36Typed property Foo::$property1 must not be accessed before initialization 37