A young boy's fascination with garbage trucks almost turned deadly when he came close to being crushed after hiding in a bin in Victoria's north.

Nine-year-old Connor, of Yarrawonga, was curious to see what the inside of a dump truck looked like and hid inside a bin and waited to be picked up.

A short time later, the bin, containing Connor, was dumped into the hopper at the back of the truck.

In a fortunate twist of fate, the keen-eyed truck driver, Dylan Jones, checked his safety camera and spotted the young boy clinging to the side of the vehicle.

Had the driver not seen him, the truck's hydraulic system would have almost certainly crushed Connor to death.

"There's a big paddle in the back that crushes all the rubbish up and compacts it all," Dylan said. "If he got caught under that, it could have been really, really bad."

Connor had previously been warned not to play near the bins because of the dangers, but curiosity got the better of him.

"I just wanted to know what it looked like inside the dump truck," Connor told 7News.

"I hid in the bin hoping to hold on to the ledge and I slipped.

"He (truck driver) didn't know I was in there. My shoe got stuck and I started to get dragged by my shoe.

"He saw my hands in the mirror so he pushed the stop button and helped me get out.

"He was nice enough to help me get my shoe and sock out of there too."

A frightening close call, the Dylan had almost completed his final round of pick ups and was about to turn on the trash compactor.

Amazingly, Connor escaped the frightening ordeal with a only a few cuts and bruises.

"I felt grateful that I was out and that I'm still alive," he said.