Code Kings
Published in

Code Kings

Phalcon 4 | PHP 7 -> AH00052: child pid 11 exit signal Segmentation fault (11) error? This is why…

Brett Jordan

The Issue

This is a quick post that will save you a ton of time trying to figure out what is going on.

When I was trying to pull some records from the model, I came across this error. The reason this is happening, is because you cannot use a magic getter method on the model that has been set to hasMany, because you are returning a result set that is an array of objects instead of simply an object as you would

The Solution

Change from this:

$model = ExampleModel::find();
$records = $model->getRelatedModel();

To this:

$model = ExampleModel::find();
$records = [];
foreach($model as $result){
$records[] = $result->getRelatedModel();

Then you should be good to go.

Happy Coding!




Programming tips & tricks from professionals

Recommended from Medium

The Magic Quadrant Report of Gartner Ranked Tellius as a Leader.

Limited WIP — test && commit || revert

A couple of ways to learn coding better (not faster)

Redis clients instrumented by OpenCensus in Java and Go

Using Google Cloud Key Management Service with Dataflow Templates

Linux Device Drivers — Chapter Two (Part 1)

AWS Serverless Application Model ( SAM )

Kth Largest | Rust

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tony Mucci

Tony Mucci

Founder of My Company Tools • Co-Founder/Former CTO of Dree • Co-Founder of Eklect Enterprises. Opinions on this blog are my own.

More from Medium

Get CRUD System with Live Input Data Validation using PHP with Free Source Code

How to configure Phalcon in Nginx Server

Web server on windows for local development

Using Redis to store PHP session with Plesk VPS