定制 donatj/drop 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

donatj/drop

最新稳定版本:v1.1.1

Composer 安装命令:

composer require donatj/drop

包简介

Simple debugging methods with CLI support

README 文档

README

Latest Stable Version License ci.yml

"The most effective debugging tool is still careful thought, coupled with judiciously placed print statements."

— Brian Kernighan, "Unix for Beginners" (1979)

While debugging small issues, you sometimes just want to see the contents of a variable or two. Firing up a full debugger can be overkill for quick problems, and var_dump(…); exit(1); is a little unwieldy and only accepts a single argument.

drop() is a simple debugging tool that allows you to drop one of more variable's contents in simple format that is friendly and readable on both web and CLI output.

see() is similar to drop() but it does not halt execution.

Acknowledgements

This was based on the work of my friend Jon Henderson before it was given its own repo.

Example

<?php

require __DIR__ . '/../vendor/autoload.php';

drop(1, 2.0, "3", false, [ 1, 2.0, "3", false ]);
||||||||||||||||||||| Arg No. 0  |||||||||||||||||||||||||||||||||||||||||||



1



||||||||||||||||||||| Arg No. 1  |||||||||||||||||||||||||||||||||||||||||||



2.0



||||||||||||||||||||| Arg No. 2  |||||||||||||||||||||||||||||||||||||||||||



'3'



||||||||||||||||||||| Arg No. 3  |||||||||||||||||||||||||||||||||||||||||||



false



||||||||||||||||||||| Arg No. 4  |||||||||||||||||||||||||||||||||||||||||||



Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] =>
)




||||||||||||||||||||| EOF ||||||||||||||||||||||||||||||||||||||||||||||||||

Requirements

  • php: >=7.1

Installing

Install the latest version with:

composer require 'donatj/drop'

Documentation

Function: \drop

function drop(...$args) : void
Parameters:
  • mixed $args - The arguments to expose the values of
Returns:
  • never - Exit's with status 1

A helpful function to empty output buffers and take any number of arguments and expose them.

This is particularly helpful for looking into arrays and objects to see what information lies
within. This function will also kill the script after echoing the information. This function
takes any number of any typed arguments and displays them all.

Function: \see

function see(...$args) : void
Parameters:
  • mixed $args

A handy function to expose any number of any typed arguments while NOT killing the script
after output.

统计信息

  • 总下载量: 138.69k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 25
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固