$options = [
'compile' => [
'strict_properties' => 'strict'
]
];
package_register('NewCode', $options);
$options = [
'compile' => [
]
];
package_register('OldCode', $options);
For people who don't set that setting, or have code that isn't in a package, there is no change. But internals start telling people, if you want to have easier upgrades, start putting your code into packages, so that BC breaks are easier to manage.
$options = [
'compile' => [
]
];
package_register('OldCode', $options); // gives warning that 'strict_properties' will change default in next version
Users can turn off the warning by explicitly setting 'no'
$options = [
'compile' => [
'strict_properties' => 'no'
]
];
package_register('OldCode', $options); // no warning.
People who have put their code in packages can manage their changes. People who have code outside of packages will inevitably still whine.
$options = [
'compile' => [
'strict_properties' => 'no'
]
];
package_register('OldCode', $options); // Warning, 'strict_properties is deprecated, extend StdClass if you want to keep the behaviour'
$options = [
'compile' => [
'strict_properties' => 'no'
]
];
package_register('OldCode', $options); // throw error - 'strict_properties is gone'
Doing it like that means that: i) people can opt into it. ii) people can migrate chunks of an application at a time, rather than having to touch the whole of an app at once. iii) Code can work on multiple versions of PHP, which makes upgrading far easier.