1. Reference: In Laravel 6, after the array is operated based on the array-related functions, the same input, the analysis of the differences under different execution orders (include, reference).https://www.shuijingwanwq.com/2023/06/13/7716/
2. The solution at that time: replace $value with $SectionSettingValue, temporarily avoid the problem of the variable name of the referenced variable
3. After that, there is a similar problem, which needs to be able to quickly locate which variables are caused by the names of variables. Decide to print out the variables in the file that are executed incorrectly at the beginning of the file. In the end, the print result is not null, all unset() is dropped.
\Illuminate\Support\Facades\Log::info(
'schema.v2.1.80',
[
'$sectionKey' => $sectionKey ?? null,
'$section' => $section ?? null,
'$blockKey' => $blockKey ?? null,
'$block' => $block ?? null,
'$blockOrderKey' => $blockOrderKey ?? null,
'$blocks' => $blocks ?? null,
]
);
4. The printing result is as follows, and confirm that after the last execution, the variables: $SectionKey, $Section, $BlockKey, $Block, $BlockOrderKey, and $Type are all null, and all need to be destroyed.
[2023-09-04 10:43:45] local.INFO: schema.v2.1.80 {
"$sectionKey": "image-1",
"$section": {
"type": "image",
"disabled": false,
"settings": {
"heading": "",
"heading_align": "center"
},
"blocks": {
"column-0": {
"type": "column",
"settings": {
"image": "https://xxx-s3.s3.us-east-2.amazonaws.com/image/736589fac73c7dfdbf61efadb49a95fb9af16efb.jpeg",
"mobile_image": "https://cdn.xxx.com/image/2022/03/200062b82e8cbae7cf7c48b425a33260686fd4aa3e6ed656901cb4cc7a283487.jpeg",
"url": "/"
}
},
"column-1": {
"type": "column",
"settings": {
"image": "https://xxx-s3.s3.us-east-2.amazonaws.com/image/736589fac73c7dfdbf61efadb49a95fb9af16efb.jpeg",
"mobile_image": "https://cdn.xxx.com/image/2022/03/200062b82e8cbae7cf7c48b425a33260686fd4aa3e6ed656901cb4cc7a283487.jpeg",
"url": "/"
}
}
}
},
"$blockKey": "column-1",
"$block": {
"type": "column",
"settings": {
"image": "https://xxx-s3.s3.us-east-2.amazonaws.com/image/736589fac73c7dfdbf61efadb49a95fb9af16efb.jpeg",
"mobile_image": "https://cdn.xxx.com/image/2022/03/200062b82e8cbae7cf7c48b425a33260686fd4aa3e6ed656901cb4cc7a283487.jpeg",
"url": "/"
}
},
"$blockOrderKey": 8,
"$type": [
"search",
"all_collections"
]
}
5. The code to destroy the variable is as follows
unset($sectionKey, $section, $blockKey, $block, $blockOrderKey, $type);
PHP / Laravel / Yii2 Legacy Project Maintenance & Long-Term Technical Support
If your PHP / Laravel / Yii2 project is already in production but needs bug fixing, API troubleshooting, performance optimization, developer handover support, or long-term maintenance, feel free to contact me for remote technical support.
Ideal For:
✅ PHP legacy systems without active maintenance
✅ Laravel / Yii2 project bug fixes
✅ Admin panel feature iterations
✅ RESTful API troubleshooting
✅ MySQL / Redis / Nginx performance issues
✅ Long-term remote part-time maintenance
We can start with a small task:
✅ Production error troubleshooting
✅ API issue analysis
✅ Slow query and performance bottleneck diagnosis
✅ Initial code structure review
✅ Deployment environment and log inspection
If you would like to discuss your project, please contact me and mention: PHP Maintenance Consultation.
Contact Me:
Telegram: @shuijingwan
WeChat: 13980074657
Email: shuijingwanwq@gmail.com

Leave a Reply